package visitor;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try{
			System.out.println("Making root entries...");
			Directory rootdir = new Directory("root");
			Directory bindir = new Directory("bin");
			Directory tmpdir = new Directory("tmp");
			Directory usrdir = new Directory("usr");
			rootdir.add(bindir);
			rootdir.add(tmpdir);
			rootdir.add(usrdir);
			bindir.add(new File("vi", 10000));
			bindir.add(new File("latex", 20000));
			rootdir.accept(new ListVisitor());

			System.out.println("");
			System.out.println("Making user entries...");
			Directory hoge = new Directory("hoge");
			Directory piyo = new Directory("piyo");
			Directory huga = new Directory("huga");
			usrdir.add(hoge);
			usrdir.add(piyo);
			usrdir.add(huga);
			hoge.add(new File("dialy.html", 1000));
			hoge.add(new File("Coomposite.java", 2000));
			piyo.add(new File("memo.tex", 3000));
			huga.add(new File("game.doc", 4000));
			huga.add(new File("junk.mail", 5000));
			rootdir.accept(new ListVisitor());
		}catch(FileTreatmentException e){
			e.printStackTrace();
		}
	}
}
